The buzzy and controversial millennial media brand Barstool Sports is selling a stake to a regional casino company in a deal that values the media company at $450 million, Katharine Sayre and Benjamin Mullin at the Wall Street Journal first reported on Wednesday.

Penn National, the casino company, agreed to buy a 36% stake in Barstool for $163 million, the companies announced.

Penn, which operates casinos in many of the US states where sports betting is legal and online, will become Barstool’s exclusive gaming partner as part of the deal. The companies plan to launch a Barstool-branded sportsbook in its retail casinos in the coming months and a betting app in August. Penn also will be able to use the Barstool brand in its casinos and betting properties, and launch Barstool sports bars or restaurants. Barstool, which has a coveted audience of millennial sports fans, made a big play for sports bettors last fall with the launch of a dedicated content hub for gamblers, as Business Insider previously reported. CEO Erika Nardini and founder Dave Portnoy said at the time the company aimed to build a robust database of bettors that it could attract more revenue from advertising and other revenue streams, like affiliate fees.

Casino and gaming companies, like Penn, have been partnering with and pursuing deals with media companies to gain a national profile and cut down on the costs to acquire sports bettors. Barstool said it also had talks with players like FanDuel and PointsBet ahead of the deal.

The deal between Barstool and Penn comes at a time when other digital-media companies that depend primarily on advertising revenue have struggled to live up to their high valuations. Some digital brands, like Vice Media and Refinery29, have combined in recent months. The deal could also drive other media tie-ups, as gaming companies scramble to secure media partners.

The Chernin Group, which owns 60% of Barstool Sports, will own a lesser stake of 36% after the deal with Penn closes, the companies said. Barstool employees will own the rest.

The deal also includes plans for Penn to invest another $62 million in Barstool after three years and boost its stake in Barstool to about 50%. Penn also has the option of bringing in another partner.

For a deeper look at the deal and its implications, and interviews with key execs, read our full inside story on BI Prime: The inside story of how Barstool Sports landed a deal with casino company Penn National and an eye-popping $450 million valuation

Read more about how media companies are leveraging legal sports betting on BI Prime: